<template>
  <div class="food" v-if="isShow">
    <div class="food-logo">
      <img :src="food.image_path" alt="">
      <i class="fa fa-close" @click="$emit('close')"></i>
    </div>
    <div class="food-describe">
      <h3 class="food-name">{{food.name}}</h3>
      <div class="food-sale">
        <span>月售{{food.month_sales}}</span>
        <span>好评率{{food.satisfy_rate}}%</span>
      </div>
      <div class="price">
        <span>￥{{food.activity.fixed_price}}</span>
        <count :data="food" />
      </div>
      <div class="intro">
        <span>{{food.description}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import Count from './Count'

export default {
  name: 'MyFood',
  props: {
    food: Object,
    isShow: Boolean
  },
  components: {
    Count
  }
}
</script>

<style lang="less" scoped>
.food {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 500;
  .food-logo {
    position: relative;
    img {
      height: 400px;
    }
    i {
      position: absolute;
      top: 9px;
      right: 8px;
      font-size: 20px;
      border: 1px solid #ccc;
      border-radius: 50%;
    }
  }
  .food-name {
    font-size: 20px;
    padding: 10px 12px;
  }
  .food-sale {
    font-size: 14px;
    padding: 0 12px;
  }
  .price {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    color: red;
    font-weight: 600;
  }
  .intro {
    font-size: 12px;
    padding: 0 14px;
  }
}
</style>
